package com.wcx.structure.adapter;

/**
 * 项目: design-pattern-githupdemo
 * <p>
 * 功能描述: 适配器
 *
 * @author: WuChengXing
 * @create: 2021-01-12 10:16
 **/
public class V5PowerAdapter implements V5Power {

    /**
     * 组合的方式
     */
    private V220Power v220Power;

    public V5PowerAdapter(V220Power v220Power) {
        this.v220Power = v220Power;
    }

    @Override
    public int provideV5Power() {
        int power = v220Power.provideV220Power();
        //power经过各种操作-->5
        System.out.println("适配器：我悄悄的适配了电压。");
        return 5;
    }

}
